"""
@Author : 合肥一元数智教育科技有限公司
@Date :  2025/11/6 10:42
@Description :  线程的使用
线程等待
"""
import time
from threading import Thread


def add():
    for i in range(10):
        time.sleep(0.2)
        print("add")


def sub():
    # 线程等待  阻塞
    thread1.join()
    for i in range(10):
        time.sleep(0.1)
        print("sub")


thread1 = Thread(target=add)
thread2 = Thread(target=sub)

thread1.start()
thread2.start()

